// 一级路由
import LoginVue from '@/views/LoginVue'
import LayOut from '@/views/LayOut'
import GoRent from '@/views/GoRent'
import MyRent from '@/views/MyRent'
import CollectVue from '@/views/CollectVue'
import CityList from '@/views/CityList'
import DetailVue from '@/views/DetailVue'
import CommunitySearch from '@/views/CommunitySearch'
import MapVue from '@/views/MapVue'

// 二级路由
import ZiXun from '@/views/ZiXun'
import MyMine from '@/views/MyMine'
import HomeHouse from '@/views/HomeHouse'
import FindHouse from '@/views/FindHouse'

import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: LoginVue
  },
  {
    path: '/detail',
    component: DetailVue
  },
  {
    path: '/collect',
    component: CollectVue
  },
  {
    path: '/myrent',
    component: MyRent
  },
  {
    path: '/gorent',
    component: GoRent
  },
  {
    path: '/citylist',
    component: CityList
  },
  {
    path: '/community',
    component: CommunitySearch
  },
  {
    path: '/maphouse',
    component: MapVue
  },
  {
    path: '/',
    component: LayOut,
    redirect: '/my',
    children: [{
      path: '/home',
      component: HomeHouse
    },
    {
      path: '/find',
      component: FindHouse
    },
    {
      path: '/news',
      component: ZiXun
    },
    {
      path: '/my',
      component: MyMine
    }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
